﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Brand.aspx.cs" Inherits="Skyworth.CRM.Web.BasicData.Brand" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>品牌管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <%--[if IE]>
     <link href="../themes/css/ieHack.css" rel="stylesheet" type="text/css" />
    <![endif]--%>
    <link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/pages.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/wbox.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/Messagebox.css" rel="stylesheet" type="text/css" />

    <script src="../javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../javascripts/MessageBox.js" type="text/javascript"></script>
    <script src="../javascripts/jquery.tablesorter.min.js" type="text/javascript"></script>
    <script src="../javascripts/wbox.js" type="text/javascript"></script>
    <script type="text/javascript" >
     var addWindow;
     $(document).ready(function() {
        
//        $("div.button").hover(function() { $(this).addClass("buttonHover"); },
//                                 function() { $(this).removeClass("buttonHover"); });
        $("div.buttonActive").hover(function() { $(this).addClass("buttonActiveHover"); },
                                function() { $(this).removeClass("buttonActiveHover"); })
                                
        $("ul.toolBar li").hover(function() { $(this).addClass("hover"); },
                                              function() { $(this).removeClass("hover"); })  
         //绑定表格行事件                        
        $(".tableList table.list").tablesorter();        
        
                
        $(".tableList table.list tbody tr:nth-child(even)").attr('class', "trbg");
        $(".tableList table.list tbody tr").hover(function() { $(this).addClass("hover"); },
                                            function() { $(this).removeClass("hover"); }).click(function() {
                                                $(this).addClass("selected")
                                                $(this).siblings().removeClass("selected");
                                                $("#selectedBrandID").val($(this).attr("rel"));
                                            })
        $("#btnAdd").click(function() {
           if ($(this).attr("disabled") != "disabled") {
               //绑定更新和删除按钮事件
               addWindow = $("#selectedBrandID").wBox({ title: "新增品牌信息", requestType: "iframe", target: "EditBrand.aspx?Type=add", iframeWH: { width: 375, height: 228} });
               addWindow.showBox(); 
           }
           return false;
       })

            $("#btnUpdate").click(function() {
                if ($(this).attr("disabled") != "disabled") {
                    var brandId = $("#selectedBrandID").val();
                    if (parseInt(brandId) > 0) {
                        addWindow = $("#selectedBrandID").wBox({ title: "修改品牌信息", requestType: "iframe", target: "EditBrand.aspx?Type=update&BrandId=" + brandId, iframeWH: { width: 375, height: 228} });
                        addWindow.showBox();
                    }
                    else {
                        $.Messager.Alert({ Title: '系统消息', Message: "请选择要修改的品牌！", Icon: IconType.Warning });
                    }
                    return false;
                }
            })

            $("#btnDelete").click(function() {
                if ($(this).attr("disabled") != "disabled") {
                    var brandId = $("#selectedBrandID").val();
                    if (parseInt(brandId) > 0) {
                        $.Messager.Confirm({ Title: '系统警告', Message: '你确定要删除该品牌信息吗?', Icon: IconType.Question,
                            Oncallback: function(IsYes, siteMapId) {
                                if (IsYes) { $("#btnhidDelete").trigger("click"); }
                            }
                        })
                    }
                    else {
                        $.Messager.Alert({ Title: '系统消息', Message: "请选择要删除的品牌！", Icon: IconType.Warning });
                    }
                    return false;
                }
            })
                                
    })
    </script>
</head>
<body style="background-color: #FFF">
    <form id="form1" runat="server">
    <div>
       <table width="100%">
            <tr>
                <td>
                    <div class="searchBar" style="padding: 4px 5px;">
                        <ul>
                            <li style="float: left;"><span>品牌名称：</span>
                                <asp:TextBox ID="txtBrandName" runat="server"></asp:TextBox>
                            </li>
                            <li style="float: left; padding-left: 20px">
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <asp:Button ID="btnSearch" runat="server" Text="查询" ToolTip="查询品牌信息" CssClass="serverButton"
                                          CommandArgument="5"  OnClick="btnSearch_Click" />
                                    </div>
                                </div>
                            </li>
                            <li style="clear: both" ></li>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                <div class="pageContent">
                    <div class="panelBar">
                        <ul class="toolBar">
                            <li class=""><asp:LinkButton ID="btnAdd" runat="server" CssClass="add" CommandArgument="2"><span>添加品牌信息</span> </asp:LinkButton></li>
                            <li class="line">line</li>
                            <li class=""><asp:LinkButton ID="btnUpdate" runat="server" CssClass="edit" CommandArgument="3"><span>修改品牌信息</span> </asp:LinkButton></li>
                            <li class="line">line</li>
                            <li class=""><asp:LinkButton ID="btnDelete" runat="server" CssClass="delete" CommandArgument="4"><span>删除品牌信息</span> </asp:LinkButton></li>
                            <li class="line">line</li>
                            <li class="">
                                <asp:Button ID="btnhidDelete" runat="server" Text="" Style="display: none;" OnClick="btnhidDelete_Click" />
                                <input type="hidden" style="display: none;" id="selectedBrandID" runat="server" />
                            </li>
                        </ul>
                    </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="pageContent" style="_margin-top: -2px;">
                        <div class="tableList">
                            <table class="list" width="100%">
                                <thead>
                                    <tr>                                        
                                        <th width="150" style="cursor: pointer;">
                                            <span style="float: left">品牌编码</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th width="250" style="cursor: pointer;" class="headerSortUp" >
                                            <span style="float: left">品牌名称</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">品牌描述</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>                                        
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Literal ID="BrandTableBody" runat="server"></asp:Literal>
                                </tbody>
                                <tfoot>
                                </tfoot>
                            </table>
                        </div>                       
                    </div>
                </td>
            </tr>           
        </table>
    </div>
    </form>
</body>
</html>
